package com.gagakuai.bpm.config.httpclients;


import com.gagakuai.bpm.rpcservice.openfeign.UserHttpApi;
import com.gagakuai.bpm.rpcservice.openfeign.UserHttpApiFailBackImpl;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;


@Component
public class FeignUserHttpApiFallBackFactory implements FallbackFactory<UserHttpApi> {

    private final UserHttpApiFailBackImpl userHttpApiFailBack;

    public FeignUserHttpApiFallBackFactory(UserHttpApiFailBackImpl userHttpApiFailBack){
        this.userHttpApiFailBack = userHttpApiFailBack;
    }

    @Override
    public UserHttpApi create(Throwable cause) {
        cause.printStackTrace();
        return userHttpApiFailBack;
    }
}
